package com.itheima.service;
import com.itheima.pojo.Question;
import com.itheima.service.impl.QuestionServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author: liangWeiQUQ
 * @Description: TODO
 * @DateTime: 2021/3/28 10:50
 **/
@Service
@FeignClient(value = "search-service",fallback = QuestionServiceImpl.class) //编写要调用的服务应用名称
public interface QuestionService {
    /**
       * @Author: 传闻中的梁大侠
       * @Date: 17:26 2021/3/28
       * @Parms [question]
       * @ReturnType: com.itheima.pojo.Question
       * @Description: 新增问题
     */

    @PostMapping("system/addQuestion")
    Question add(@RequestBody Question question);

    /**
       * @Author: 传闻中的梁大侠
       * @Date: 17:27 2021/3/28
       * @Parms [title]
       * @ReturnType: java.util.List<com.itheima.pojo.Question>
       * @Description: 根据问题查询答案
     */
    @PostMapping("system/answer")
    List<Question> findByAnswer(String title);
}
